package com.huawei;

import java.util.Scanner;

/**
 * Created by Z-hong on 2024/7/2.
 */

public class HJ15 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;
        int divisor=2;
        while(n>0){
            if(n==divisor){
                count++;
                break;
            }
            if(n%divisor != 0){
                count++;
                n=n-divisor/2;
            }
            divisor*=2;
        }
        System.out.println(count);
    }
}
